/**
 * Created by yubaolin on 2017/9/30.
 */
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const Home = resolve => require(['../views/admin/home.vue'], resolve)
const User = resolve => require(['../views/admin/setting/user.vue'], resolve)
const Role = resolve => require(['../views/admin/setting/role.vue'], resolve)
const Menu = resolve => require(['../views/admin/setting/menu.vue'], resolve)
const Auth = resolve => require(['../views/admin/setting/auth.vue'], resolve)
const Api = resolve => require(['../views/admin/setting/api.vue'], resolve)
const Manufacturer = resolve => require(['../views/admin/goods/manufacturer.vue'], resolve)
const Category = resolve => require(['../views/admin/goods/category.vue'], resolve)
const Goods = resolve => require(['../views/admin/goods/goods.vue'], resolve)
const GoodsSpecification = resolve => require(['../views/admin/goods/goodsSpecification.vue'], resolve)
const Shop = resolve => require(['../views/admin/shop/shop.vue'], resolve)
const Member = resolve => require(['../views/admin/member/member.vue'], resolve)
const MemberAddress = resolve => require(['../views/admin/member/memberAddress.vue'], resolve)
const Order = resolve => require(['../views/admin/order/order.vue'], resolve)
const OrderDetail = resolve => require(['../views/admin/order/orderDetail.vue'], resolve)

export default new Router({
  mode: 'history',
  base: 'index',
  linkActiveClass: 'ivu-menu-item-active',
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/setting/user',
      component: User
    },
    {
      path: '/setting/role',
      component: Role
    },
    {
      path: '/setting/menu',
      component: Menu
    },
    {
      path: '/setting/auth',
      component: Auth
    },
    {
      path: '/setting/api',
      component: Api
    },
    {
      path: '/goods/manufacturer',
      component: Manufacturer
    },
    {
      path: '/goods/category',
      component: Category
    },
    {
      path: '/goods/goods',
      component: Goods
    },
    {
      path: '/goods/specification',
      component: GoodsSpecification
    },
    {
      path: '/shop/shop',
      component: Shop
    },
    {
      path: '/member/member',
      component: Member
    },
    {
      path: '/member/address',
      component: MemberAddress
    },
    {
      path: '/order/order',
      component: Order
    },
    {
      path: '/order/orderDetail',
      component: OrderDetail
    }
  ]
})
